import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '名称',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '关联故事',
    align:"center",
    dataIndex: 'storyId_dictText'
   },
   {
    title: '流转故事',
    align:"center",
    dataIndex: 'nextStoryId_dictText'
   },
   {
    title: '展示内容',
    align:"center",
    dataIndex: 'text'
   },
   {
    title: '颜色',
    align:"center",
    dataIndex: 'color'
   },
   {
    title: '按钮类型',
    align:"center",
    dataIndex: 'type_dictText'
   },
   {
    title: '横坐标',
    align:"center",
    dataIndex: 'axisX'
   },
   {
    title: '纵坐标',
    align:"center",
    dataIndex: 'axisY'
   },
   {
    title: '逻辑项',
    align:"center",
    dataIndex: 'logicItem_dictText'
   },
   {
    title: '逻辑值',
    align:"center",
    dataIndex: 'logicValue_dictText'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'sort'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "名称",
      field: 'name',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "关联故事",
      field: 'storyId',
      component: 'JSearchSelect',
      componentProps:{
         dict:"m_story_info,name,id"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '关联故事',
    field: 'storyId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"m_story_info,name,id"
    },
  },
  {
    label: '流转故事',
    field: 'nextStoryId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"m_story_info,name,id"
    },
  },
  {
    label: '展示内容',
    field: 'text',
    component: 'Input',
  },
  {
    label: '颜色',
    field: 'color',
    component: 'Input',
  },
  {
    label: '按钮类型',
    field: 'type',
    defaultValue: "button",
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"m_button_type"
     },
  },
  {
    label: '横坐标',
    field: 'axisX',
    component: 'Input',
  },
  {
    label: '纵坐标',
    field: 'axisY',
    component: 'Input',
  },
  {
    label: '逻辑项',
    field: 'logicItem',
    component: 'JSearchSelect',
    componentProps:{
       dict:"m_story_info,name,id"
    },
  },
  {
    label: '逻辑值',
    field: 'logicValue',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"valid_status",
        type: "radio"
     },
  },
  {
    label: '排序',
    field: 'sort',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  name: {title: '名称',order: 0,view: 'text', type: 'string',},
  storyId: {title: '关联故事',order: 1,view: 'sel_search', type: 'string',dictTable: "m_story_info", dictCode: 'id', dictText: 'name',},
  nextStoryId: {title: '流转故事',order: 2,view: 'sel_search', type: 'string',dictTable: "m_story_info", dictCode: 'id', dictText: 'name',},
  text: {title: '展示内容',order: 3,view: 'text', type: 'string',},
  color: {title: '颜色',order: 4,view: 'text', type: 'string',},
  type: {title: '按钮类型',order: 5,view: 'list', type: 'string',dictCode: 'm_button_type',},
  axisX: {title: '横坐标',order: 6,view: 'text', type: 'string',},
  axisY: {title: '纵坐标',order: 7,view: 'text', type: 'string',},
  logicItem: {title: '逻辑项',order: 8,view: 'sel_search', type: 'string',dictTable: "m_story_info", dictCode: 'id', dictText: 'name',},
  logicValue: {title: '逻辑值',order: 9,view: 'radio', type: 'string',dictCode: 'valid_status',},
  sort: {title: '排序',order: 10,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}